package adv3;

import java.util.*;

import adv2.Book;

public class SetTest2 {

	public static void main(String[] args) {
		Set set = new HashSet();
		set.add(new Book("七天学会java", "吹牛专用", 100));
		set.add(new Book("二十一天学会java", "吹牛专用", 100));
		set.add(new Book("六个月学会java", "务实", 1000));
		System.out.println(set.size());
		boolean in = set.add(new Book("七天学会java", "吹牛专用", 2000));
		System.out.println("加入成功了？" + in);
		System.out.println(set.size());
		System.out.println(set);

		Book b1 = new Book("七天学会java", null, 0);
		boolean b2 = set.remove(b1);
		System.out.println("b1删除成功了？" + b2);
		System.out.println(set);
		System.out.println(">>>>>>>>>>>>>>>>>>>>>>>");
		for (Object o : set) {
			System.out.println(">>>" + o);
		}
	}

}
